<UserControl x:Class="Rage.UI.GraphDisplay"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:inputToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.WPFToolkit"
  xmlns:layoutToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit"
  xmlns:splitButton="clr-namespace:Delay;assembly=SplitButtonWpf"
  xmlns:System="clr-namespace:System;assembly=mscorlib"
  xmlns:local="clr-namespace:Rage.UI"
  mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="680">

  <UserControl.Resources>
    <HierarchicalDataTemplate x:Key="FilterTemplate" ItemsSource="{Binding Filters}">
      <CheckBox Margin="0" Content="{Binding Name}" IsChecked="{Binding Enabled, Mode=TwoWay}" IsTabStop="False" IsThreeState="True" />
    </HierarchicalDataTemplate>
  </UserControl.Resources>

  <Grid x:Name="LayoutRoot" Margin="1,1,1,1" d:LayoutOverrides="Width, Height">
    <Grid.RowDefinitions>
      <RowDefinition Height="30" />
      <RowDefinition Height="30" />
      <RowDefinition Height="*" />
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="2*" />
      <ColumnDefinition Width="1*" />
    </Grid.ColumnDefinitions>

    <!-- Header -->
    <Rectangle x:Name="BarBackground" Canvas.ZIndex="1" Grid.ColumnSpan="3" Margin="0,0,0,-1" VerticalAlignment="Stretch">
      <Rectangle.Stroke>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
          <GradientStop Color="#FFA3AEB9" />
          <GradientStop Color="#FF8399A9" Offset="0.375" />
          <GradientStop Color="#FF718597" Offset="0.375" />
          <GradientStop Color="#FF617584" Offset="1" />
        </LinearGradientBrush>
      </Rectangle.Stroke>
      <Rectangle.Fill>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
          <GradientStop Color="#FFDEDEDE" Offset="1" />
          <GradientStop Color="#FFFFFFFF" Offset="0" />
        </LinearGradientBrush>
      </Rectangle.Fill>
    </Rectangle>

    <Grid Canvas.ZIndex="2" Grid.ColumnSpan="3" Margin="0,4,0,4" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="*" />
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="Auto" />
        <ColumnDefinition Width="Auto" />
      </Grid.ColumnDefinitions>

      <local:ChartPicker x:Name="ChartPicker1" Grid.Column="0" HorizontalAlignment="Left" />
      <Rectangle Grid.Column="1" Margin="2" Width="1" Fill="#4C000000" Stroke="#F0000000" StrokeThickness="0" />
      <TextBlock x:Name="LB_LiveFilter" Grid.Column="2" Margin="2,0" Text="Find:" TextWrapping="Wrap" VerticalAlignment="Center" />
      <TextBox x:Name="TB_LiveFilter" Grid.Column="3" ToolTipService.ToolTip="Type text to find in this list and press enter." Margin="2,0" Background="White" HorizontalAlignment="Stretch" KeyDown="TB_LiveFilter_KeyDown" />
      <Button x:Name="BT_AdvSearch" Grid.Column="4" ToolTipService.ToolTip="Opens an Advanced Search box which will display results in a special chart." Margin="2,0" Click="BT_AdvSearch_Click" Content="Adv. Search" HorizontalAlignment="Right" />
      <CheckBox x:Name="CK_UseRegex" Grid.Column="5" ToolTipService.ToolTip="Checking this will use Regex on Advanced Searches" Content="" HorizontalAlignment="Right" VerticalAlignment="Center" />
      <Rectangle Grid.Column="6" Margin="2" Width="1" Fill="#4C000000" Stroke="#F0000000" StrokeThickness="0" />
      <TextBlock Grid.Column="7" Margin="2,0" Text="Sort:" VerticalAlignment="Center" />
      <ComboBox x:Name="SortCombo" Grid.Column="8" Margin="2,0" Width="128" SelectedIndex="1" SelectionChanged="SortChanged">
        <System:String>Alphabetical</System:String>
        <System:String>Overall</System:String>
      </ComboBox>
      <Rectangle Grid.Column="9" Margin="2" Width="1" Fill="#4C000000" Stroke="#F0000000" StrokeThickness="0" />
      <local:ItemFilterPopup x:Name="FilterPopup" Grid.Column="10" HorizontalAlignment="Left" />
      <splitButton:MenuButton x:Name="ExportMenu" Grid.Column="11" Margin="2,0" Padding="6,1,6,1" Content="Export" HorizontalAlignment="Left">
        <splitButton:MenuButton.ButtonMenuItemsSource>
          <MenuItem Click="CopyCSVDataToClipboard" Header="Copy Data to Clipboard" />
          <MenuItem Click="ExportToCSV" Header="Export to CSV..." />
          <MenuItem x:Name="MI_PawnExport" Click="ExportToPawn" Header="Copy Pawn String to Clipboard" />
          <MenuItem Header="Export to Image... (NYI)" />
        </splitButton:MenuButton.ButtonMenuItemsSource>
      </splitButton:MenuButton>
      <Button x:Name="ButtonExpand" Grid.Column="12" ToolTipService.ToolTip="Click to Expand or Collapse the Filters frame" Margin="2,0" Padding="8,1" Click="ButtonExpand_Click" Content="Filters" />
    </Grid>
    <local:ComparisonGraphLegend x:Name="CGL_Legend" Grid.ColumnSpan="1" Grid.Row="1" />
    <!-- Body -->
    <!--IFSL
        <ScrollViewer x:Name="GraphScroll" Background="#FFFFFFFF" Grid.Row="2" Margin="0,-1,0,0" VerticalScrollBarVisibility="Auto"  Grid.ColumnSpan="1">
            <local:ComparisonGraph x:Name="ComparisonGraph" VerticalAlignment="Top" />
        ENDIFSL-->
    <!--IFWPF-->
    <ScrollViewer x:Name="GraphScroll" Grid.ColumnSpan="1" Grid.Row="2" Margin="0,-1,0,0" Background="#FFFFFFFF" BorderThickness="1" VerticalScrollBarVisibility="Auto">
      <ScrollViewer.BorderBrush>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
          <LinearGradientBrush.RelativeTransform>
            <TransformGroup>
              <ScaleTransform CenterX="0.5" CenterY="0.5" />
              <SkewTransform CenterX="0.5" CenterY="0.5" />
              <RotateTransform CenterX="0.5" CenterY="0.5" />
              <TranslateTransform />
            </TransformGroup>
          </LinearGradientBrush.RelativeTransform>
          <GradientStop Color="#FFA3AEB9" Offset="0" />
          <GradientStop Color="#FF617584" Offset="1" />
          <GradientStop Color="#FF718597" Offset="0.375" />
        </LinearGradientBrush>
      </ScrollViewer.BorderBrush>
      <local:ComparisonGraph x:Name="ComparisonGraph" BorderThickness="1" VerticalAlignment="Top">
        <local:ComparisonGraph.BorderBrush>
          <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
            <LinearGradientBrush.RelativeTransform>
              <TransformGroup>
                <ScaleTransform CenterX="0.5" CenterY="0.5" />
                <SkewTransform CenterX="0.5" CenterY="0.5" />
                <RotateTransform CenterX="0.5" CenterY="0.5" />
                <TranslateTransform />
              </TransformGroup>
            </LinearGradientBrush.RelativeTransform>
            <GradientStop Color="#FFA3AEB9" Offset="0" />
            <GradientStop Color="#FF617584" Offset="1" />
            <GradientStop Color="#FF718597" Offset="0.375" />
          </LinearGradientBrush>
        </local:ComparisonGraph.BorderBrush>
      </local:ComparisonGraph>
      <!--ENDIFWPF-->
    </ScrollViewer>
    <!--IFSL
        <sdk:GridSplitter x:Name="FilterSplitter" MouseLeftButtonUp="GridSplitter_MouseLeftButtonUp" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" ShowsPreview="True" HorizontalAlignment="Left" Visibility="Visible">
        ENDIFSL-->
    <!--IFWPF-->
    <GridSplitter x:Name="FilterSplitter" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Left" MinWidth="10" MouseLeftButtonUp="GridSplitter_MouseLeftButtonUp" ShowsPreview="True" Visibility="Visible">
    <!--ENDIFWPF-->
      <GridSplitter.Background>
        <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
          <GradientStop Color="White" Offset="0" />
          <GradientStop Color="#FFDEDEDE" Offset="1" />
        </LinearGradientBrush>
      </GridSplitter.Background>
    </GridSplitter>
    <Grid Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" Margin="10,0,0,0" Visibility="Visible">
      <layoutToolkit:Accordion x:Name="FilterAccordion" HorizontalAlignment="Stretch" SelectionMode="OneOrMore" SelectionSequence="Simultaneous" VerticalAlignment="Stretch">
        <layoutToolkit:Accordion.BorderBrush>
          <LinearGradientBrush EndPoint="1,0.4" StartPoint="0,0.4">
            <GradientStop Color="#FFA3AEB9" Offset="0" />
            <GradientStop Color="#FF617584" Offset="1" />
            <GradientStop Color="#FF718597" Offset="0.333" />
          </LinearGradientBrush>
        </layoutToolkit:Accordion.BorderBrush>
        <layoutToolkit:AccordionItem x:Name="AI_Source" Header="Filters by Source" HorizontalContentAlignment="Stretch" IsSelected="True" VerticalContentAlignment="Stretch">
          <Grid Margin="0">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="*" />
              <ColumnDefinition Width="Auto" />
              <ColumnDefinition Width="Auto" />
              <ColumnDefinition Width="Auto" />
              <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
              <RowDefinition Height="Auto" />
              <RowDefinition />
            </Grid.RowDefinitions>
            <Button Grid.Column="1" Margin="1" Padding="8,1" Click="BT_SourceFilters_Reset_Click" Content="Reset" Name="BT_SourceFilters_Reset" VerticalAlignment="Top" />
            <Button Grid.Column="3" Margin="1" Padding="8,1" Click="BT_SourceFilters_UnCheckAll_Click" Content="UnCheck All" Name="BT_SourceFilters_UnCheckAll" VerticalAlignment="Top" />
            <Button Grid.Column="4" Margin="1" Padding="8,1" Click="ShowItemFilters" Content="Edit" Name="BT_EditSourceFilters" VerticalAlignment="Top" />
            <TextBlock Grid.Column="0" Grid.ColumnSpan="5" Grid.Row="1" Margin="2" Text="Note: Some items may have multiple sources" TextWrapping="Wrap" VerticalAlignment="Center" />
            <TreeView x:Name="FilterTree" Grid.ColumnSpan="5" Grid.Row="2" Margin="0" Padding="0" Background="Transparent" BorderThickness="0" ItemTemplate="{StaticResource FilterTemplate}">
              <TreeView.ItemsPanel>
                <ItemsPanelTemplate>
                  <!--IFSL
                                    <StackPanel Orientation="Vertical" Margin="-6,-8,-10,-8"/>
                                    ENDIFSL-->
                  <!--IFWPF-->
                  <StackPanel Margin="0" Orientation="Vertical" />
                  <!--ENDIFWPF-->
                </ItemsPanelTemplate>
              </TreeView.ItemsPanel>
            </TreeView>
          </Grid>
        </layoutToolkit:AccordionItem>
        <layoutToolkit:AccordionItem x:Name="AI_Type" Header="Filters by Item Type" HorizontalContentAlignment="Stretch" IsSelected="False" VerticalAlignment="Stretch" VerticalContentAlignment="Stretch">
          <Grid Margin="0">
            <Grid.ColumnDefinitions>
              <ColumnDefinition />
              <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
              <RowDefinition />
            </Grid.RowDefinitions>
            <TextBlock Margin="2" Text="Make your changes then click Apply" TextWrapping="Wrap" VerticalAlignment="Center" />
            <Button Grid.Column="1" Margin="1" Padding="8,3" Click="CheckBox_Click" Content="Apply" Name="BT_ApplyTypeFilter" VerticalAlignment="Top" />
            <ScrollViewer x:Name="SV_Type" Grid.ColumnSpan="2" Grid.Row="1">
              <WrapPanel>
                <Grid Margin="2">
                  <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                  </Grid.RowDefinitions>
                  <Rectangle Grid.RowSpan="6" Margin="0,8,0,0" Stroke="DarkGray" StrokeLineJoin="Bevel" />
                  <Label Grid.Row="0" Margin="4,0" Padding="2,0" Background="White" Content="Melee Weapons" FontWeight="Bold" HorizontalAlignment="Left" />
                  <CheckBox Grid.Row="1" Margin="4,0" Content="Lightsabers" Name="CheckBoxLightsaber" Tag="Lightsaber" />
                  <CheckBox Grid.Row="2" Margin="4,0" Content="Vibroknives" Name="CheckBoxVibroknife" Tag="Vibroknife" />
                  <CheckBox Grid.Row="3" Margin="4,0" Content="Vibroswords" Name="CheckBoxVibrosword" Tag="Vibrosword" />
                  <CheckBox Grid.Row="4" Margin="4,0" Content="Double-Bladed Lightsabers" Name="CheckBoxDoubleBladedLightsaber" Tag="DoubleBladedLightsaber" />
                  <CheckBox Grid.Row="5" Margin="4,0" Content="Techblades" Name="CheckBoxTechblade" Tag="Techblade" />
                  <CheckBox Grid.Row="5" Margin="4,0" Content="Electrostaves" Name="CheckBoxElectroStaff" Tag="ElectroStaff" />
                  <CheckBox Grid.Row="5" Margin="4,0" Content="TechStaves" Name="CheckBoxTechStaff" Tag="TechStaff" />
                </Grid>
                <Grid Margin="2">
                  <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                  </Grid.RowDefinitions>
                  <Rectangle Grid.RowSpan="6" Margin="0,8,0,0" Stroke="DarkGray" StrokeLineJoin="Bevel" />
                  <Label Grid.Row="0" Margin="4,0" Padding="2,0" Background="White" Content="Ranged Weapons" FontWeight="Bold" HorizontalAlignment="Left" />
                  <CheckBox Grid.Row="1" Margin="4,0" Content="Blaster Rifle" Name="CheckBoxBlasterRifle" Tag="BlasterRifle" />
                  <CheckBox Grid.Row="2" Margin="4,0" Content="Assault Cannon" Name="CheckBoxAssaultCannon" Tag="AssaultCannon" />
                  <CheckBox Grid.Row="3" Margin="4,0" Content="Sniper Rifle" Name="CheckBoxSniperRifle" Tag="SniperRifle" />
                  <CheckBox Grid.Row="4" Margin="4,0" Content="Blaster Pistol" Name="CheckBoxBlasterPistol" Tag="BlasterPistol" />
                  <CheckBox Grid.Row="5" Margin="4,0" Content="Shotgun" Name="CheckBoxShotgun" Tag="Shotgun" />
                </Grid>
                <Grid Margin="2">
                  <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                  </Grid.RowDefinitions>
                  <Rectangle Grid.RowSpan="6" Margin="0,8,0,0" Stroke="DarkGray" StrokeLineJoin="Bevel" />
                  <Label Grid.Row="0" Margin="4,0" Padding="2,0" Background="White" Content="Armor" FontWeight="Bold" HorizontalAlignment="Left" />
                  <CheckBox Grid.Row="1" Margin="4,0" Content="Light" Name="CheckBoxLight" Tag="Light" />
                  <CheckBox Grid.Row="2" Margin="4,0" Content="Medium" Name="CheckBoxMedium" Tag="Medium" />
                  <CheckBox Grid.Row="4" Margin="4,0" Content="Heavy" Name="CheckBoxHeavy" Tag="Heavy" />
                  <CheckBox Grid.Row="5" Margin="4,0" Content="Ear" Name="CheckBoxEar" Tag="Ear" />
                  <CheckBox Grid.Row="3" Margin="4,0" Content="Implant" Name="CheckBoxImplant" Tag="Implant" />
                  <CheckBox Grid.Row="6" Margin="4,0" Content="Relic" Name="CheckBoxRelic" Tag="Relic" />
                </Grid>
                <Grid Margin="2">
                  <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                  </Grid.RowDefinitions>
                  <Rectangle Grid.RowSpan="6" Margin="0,8,0,0" Stroke="DarkGray" StrokeLineJoin="Bevel" />
                  <Label Grid.Row="0" Margin="4,0" Padding="2,0" Background="White" Content="Off-Hand" FontWeight="Bold" HorizontalAlignment="Left" />
                  <CheckBox Grid.Row="1" Margin="4,0" Content="Shield" Name="CheckBoxShield" Tag="Shield" />
                  <CheckBox Grid.Row="2" Margin="4,0" Content="Focus" Name="CheckBoxFocus" Tag="Focus" />
                  <CheckBox Grid.Row="2" Margin="4,0" Content="Generator" Name="CheckBoxGenerator" Tag="Generator" />
                </Grid>
              </WrapPanel>
            </ScrollViewer>
          </Grid>
        </layoutToolkit:AccordionItem>
        <layoutToolkit:AccordionItem x:Name="AI_Bind" ToolTipService.ToolTip="Items that Bind under certain conditions." Header="Filters by Bind Type" HorizontalContentAlignment="Stretch" IsSelected="False" VerticalContentAlignment="Stretch">
          <ScrollViewer x:Name="SV_Bind">
            <Grid>
              <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
              </Grid.RowDefinitions>
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
              </Grid.ColumnDefinitions>

              <TextBlock Grid.ColumnSpan="3" Grid.Row="0" Text="Check the groupings you want to see." TextWrapping="Wrap" />

              <Grid Grid.ColumnSpan="3" Grid.Row="1">
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="*" />
                  <ColumnDefinition Width="Auto" />
                  <ColumnDefinition Width="Auto" />
                  <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <Button Grid.Column="1" Grid.Row="1" Margin="1" Padding="8,1" Click="BT_SourceFiltersBind_Reset_Click" Content="Reset" Name="BT_SourceFiltersBind_Reset" VerticalAlignment="Top" />
                <Button Grid.Column="2" Grid.Row="1" Margin="1" Padding="8,1" Click="BT_SourceFiltersBind_UnCheckAll_Click" Content="UnCheck All" Name="BT_SourceFiltersBind_UnCheckAll" VerticalAlignment="Top" />
              </Grid>

              <StackPanel Grid.ColumnSpan="3" Grid.Row="3">
                <CheckBox x:Name="CK_Bind_0" Margin="4,0" Content="Doesn't Bind" />
                <CheckBox x:Name="CK_Bind_1" Margin="4,0" Content="Binds to Account" />
                <CheckBox x:Name="CK_Bind_2" Margin="4,0" Content="Binds on Use" />
                <CheckBox x:Name="CK_Bind_3" Margin="4,0" Content="Binds on Equip" />
                <CheckBox x:Name="CK_Bind_4" Margin="4,0" Content="Binds on Pickup" />
              </StackPanel>
            </Grid>
          </ScrollViewer>
        </layoutToolkit:AccordionItem>
        <layoutToolkit:AccordionItem x:Name="AI_Drop" Header="Filters by Drop Rate" HorizontalContentAlignment="Stretch" IsSelected="False" VerticalContentAlignment="Stretch">
          <ScrollViewer x:Name="SV_Drop">
            <Grid>
              <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
              </Grid.RowDefinitions>
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
              </Grid.ColumnDefinitions>

              <TextBlock Grid.ColumnSpan="3" Grid.Row="0" Text="You can select the groupings you want to see OR use the slider for a custom view." TextWrapping="Wrap" />

              <Grid Grid.ColumnSpan="3" Grid.Row="1">
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="*" />
                  <ColumnDefinition Width="Auto" />
                  <ColumnDefinition Width="Auto" />
                  <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <Button Grid.Column="1" Grid.Row="1" Margin="1" Padding="8,1" Click="BT_SourceFiltersDrop_Reset_Click" Content="Reset" Name="BT_SourceFiltersDrop_Reset" VerticalAlignment="Top" />
                <Button Grid.Column="2" Grid.Row="1" Margin="1" Padding="8,1" Click="BT_SourceFiltersDrop_UnCheckAll_Click" Content="UnCheck All" Name="BT_SourceFiltersDrop_UnCheckAll" VerticalAlignment="Top" />
              </Grid>

              <RadioButton x:Name="RB_Drop_Checks" Grid.ColumnSpan="3" Grid.Row="2" Margin="4,0" Content="By Checking Groups" GroupName="Filters_Drop" IsChecked="True" />
              <StackPanel Grid.ColumnSpan="3" Grid.Row="3">
                <CheckBox x:Name="CK_Drop_00" Margin="4,0" Content="&gt;=00% &lt;01%" IsEnabled="{Binding ElementName=RB_Drop_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_Drop_01" Margin="4,0" Content="&gt;=01% &lt;03%" IsEnabled="{Binding ElementName=RB_Drop_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_Drop_02" Margin="4,0" Content="&gt;=03% &lt;05%" IsEnabled="{Binding ElementName=RB_Drop_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_Drop_03" Margin="4,0" Content="&gt;=05% &lt;10%" IsEnabled="{Binding ElementName=RB_Drop_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_Drop_04" Margin="4,0" Content="&gt;=10% &lt;15%" IsEnabled="{Binding ElementName=RB_Drop_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_Drop_05" Margin="4,0" Content="&gt;=15% &lt;20%" IsEnabled="{Binding ElementName=RB_Drop_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_Drop_06" Margin="4,0" Content="&gt;=20% &lt;25%" IsEnabled="{Binding ElementName=RB_Drop_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_Drop_07" Margin="4,0" Content="&gt;=25% &lt;30%" IsEnabled="{Binding ElementName=RB_Drop_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_Drop_08" Margin="4,0" Content="&gt;=30% &lt;40%" IsEnabled="{Binding ElementName=RB_Drop_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_Drop_09" Margin="4,0" Content="&gt;=40% &lt;50%" IsEnabled="{Binding ElementName=RB_Drop_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_Drop_10" Margin="4,0" Content="&gt;=50% &lt;=100%" IsEnabled="{Binding ElementName=RB_Drop_Checks, Path=IsChecked}" />
              </StackPanel>

              <RadioButton x:Name="RB_Drop_Sliders" Grid.ColumnSpan="3" Grid.Row="4" Margin="4,0" Content="By Custom Slider" GroupName="Filters_Drop" IsChecked="True" />
              <local:RangeSlider x:Name="RS_Drop" Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="6" Margin="2" IsEnabled="{Binding ElementName=RB_Drop_Sliders, Path=IsChecked}" IsHorizontal="True" LowerValue="0" Maximum="100" Minimum="0" ShowLabels="True" ShowTicks="True" TickFrequency="10" UpperValue="100" />
              <inputToolkit:NumericUpDown Grid.Column="0" Grid.Row="5" Margin="2" IsEnabled="{Binding ElementName=RB_Drop_Sliders, Path=IsChecked}" Maximum="{Binding ElementName=RS_Drop, Path=UpperValue}" Minimum="0" MinWidth="50" Name="NUD_Drop_Min" Value="{Binding ElementName=RS_Drop, Path=LowerValue, Mode=TwoWay}" />
              <inputToolkit:NumericUpDown Grid.Column="2" Grid.Row="5" Margin="2" IsEnabled="{Binding ElementName=RB_Drop_Sliders, Path=IsChecked}" Maximum="100" Minimum="{Binding ElementName=RS_Drop, Path=LowerValue}" MinWidth="50" Name="NUD_Drop_Max" Value="{Binding ElementName=RS_Drop, Path=UpperValue, Mode=TwoWay}" />
            </Grid>
          </ScrollViewer>
        </layoutToolkit:AccordionItem>
        <layoutToolkit:AccordionItem x:Name="AI_iLevel" Header="Filters by Item Level" HorizontalContentAlignment="Stretch" IsSelected="False" VerticalContentAlignment="Stretch">
          <ScrollViewer x:Name="SV_iLevel">
            <Grid>
              <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
              </Grid.RowDefinitions>
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
              </Grid.ColumnDefinitions>

              <TextBlock Grid.ColumnSpan="3" Grid.Row="0" Text="You can select the groupings you want to see OR use the slider for a custom view." TextWrapping="Wrap" />

              <Grid Grid.ColumnSpan="3" Grid.Row="1">
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="*" />
                  <ColumnDefinition Width="Auto" />
                  <ColumnDefinition Width="Auto" />
                  <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <Button Grid.Column="1" Grid.Row="1" Margin="1" Padding="8,1" Click="BT_SourceFiltersILvl_Reset_Click" Content="Reset" Name="BT_SourceFiltersIlvl_Reset" VerticalAlignment="Top" />
                <Button Grid.Column="2" Grid.Row="1" Margin="1" Padding="8,1" Click="BT_SourceFiltersILvl_UnCheckAll_Click" Content="UnCheck All" Name="BT_SourceFiltersIlvl_UnCheckAll" VerticalAlignment="Top" />
                <!--<Button Content="Edit" Grid.Row="1" Grid.Column="3" Margin="1" Padding="8,1" Click="ShowItemFilters" Name="BT_EditSourceFiltersIlvl" VerticalAlignment="Top" Visibility="Collapsed"/>-->
              </Grid>

              <RadioButton x:Name="RB_iLvl_Checks" Grid.ColumnSpan="3" Grid.Row="2" Margin="4,0" Content="By Checking Groups" GroupName="Filters_iLvL" IsChecked="True" />
              <StackPanel Grid.ColumnSpan="3" Grid.Row="3">
                <CheckBox x:Name="CK_iLvl_0" Margin="4,0" Content="000-001 (Heirloom)" IsEnabled="{Binding ElementName=RB_iLvl_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_iLvl_1" Margin="4,0" Content="002-199 (Tier 01-06)" IsEnabled="{Binding ElementName=RB_iLvl_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_iLvl_2" Margin="4,0" Content="200-284 (Tier 07-10)" IsEnabled="{Binding ElementName=RB_iLvl_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_iLvl_3" Margin="4,0" Content="285-333 (Cata Dungeons)" IsEnabled="{Binding ElementName=RB_iLvl_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_iLvl_4" Margin="4,0" Content="334-352 (Cata Heroics)" IsEnabled="{Binding ElementName=RB_iLvl_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_iLvl_5" Margin="4,0" Content="353-358 (Rise of Zandalar)" IsEnabled="{Binding ElementName=RB_iLvl_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_iLvl_6" Margin="4,0" Content="359-364 (Tier 11.0)" IsEnabled="{Binding ElementName=RB_iLvl_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_iLvl_7" Margin="4,0" Content="365-371 (Molten Front)" IsEnabled="{Binding ElementName=RB_iLvl_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_iLvl_8" Margin="4,0" Content="372-377 (Tier 11.5)" IsEnabled="{Binding ElementName=RB_iLvl_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_iLvl_9" Margin="4,0" Content="378-383 (Tier 12.0/Hour of Twilight)" IsEnabled="{Binding ElementName=RB_iLvl_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_iLvl_10" Margin="4,0" Content="384-390 (Tier 13.LFR)" IsEnabled="{Binding ElementName=RB_iLvl_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_iLvl_11" Margin="4,0" Content="391-396 (Tier 12.5)" IsEnabled="{Binding ElementName=RB_iLvl_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_iLvl_12" Margin="4,0" Content="397-409 (Tier 13.0)" IsEnabled="{Binding ElementName=RB_iLvl_Checks, Path=IsChecked}" />
                <CheckBox x:Name="CK_iLvl_13" Margin="4,0" Content="410-416 (Tier 13.5)" IsEnabled="{Binding ElementName=RB_iLvl_Checks, Path=IsChecked}" />
              </StackPanel>

              <RadioButton x:Name="RB_iLvl_Sliders" Grid.ColumnSpan="3" Grid.Row="4" Margin="4,0" Content="By Custom Slider" GroupName="Filters_iLvL" IsChecked="True" />
              <local:RangeSlider x:Name="RS_iLvl" Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="6" Margin="2" IsEnabled="{Binding ElementName=RB_iLvl_Sliders, Path=IsChecked}" IsHorizontal="True" LowerValue="285" Maximum="500" Minimum="0" ShowLabels="True" ShowTicks="True" TickFrequency="50" UpperValue="397" d:TickFrequency="50" />
              <inputToolkit:NumericUpDown Grid.Column="0" Grid.Row="5" Margin="2" IsEnabled="{Binding ElementName=RB_iLvl_Sliders, Path=IsChecked}" Maximum="{Binding ElementName=RS_iLvl, Path=UpperValue}" Minimum="0" MinWidth="50" Name="NUD_iLvl_Min" Value="{Binding ElementName=RS_iLvl, Path=LowerValue, Mode=TwoWay}" />
              <inputToolkit:NumericUpDown Grid.Column="2" Grid.Row="5" Margin="2" IsEnabled="{Binding ElementName=RB_iLvl_Sliders, Path=IsChecked}" Maximum="500" Minimum="{Binding ElementName=RS_iLvl, Path=LowerValue}" MinWidth="50" Name="NUD_iLvl_Max" Value="{Binding ElementName=RS_iLvl, Path=UpperValue, Mode=TwoWay}" />
            </Grid>
          </ScrollViewer>
        </layoutToolkit:AccordionItem>
        <layoutToolkit:AccordionItem x:Name="AI_Gems" Foreground="DarkGray" Header="Gem Filters" HorizontalContentAlignment="Stretch" IsEnabled="False" IsSelected="False" VerticalContentAlignment="Stretch">
          <ScrollViewer x:Name="SV_Gems">
            <StackPanel>
              <CheckBox Margin="4,0" Content="Jewelcrafter BoP" />
              <CheckBox Margin="4,0" Content="Crafted (Non-BoP)" />
              <CheckBox Margin="4,0" Content="PvP" />
              <CheckBox Margin="4,0" Content="World Drop" />
              <CheckBox Margin="4,0" Content="Quest Rewards" />
              <CheckBox Margin="4,0" Content="Unknown/Needs Refreshed" />
            </StackPanel>
          </ScrollViewer>
        </layoutToolkit:AccordionItem>
      </layoutToolkit:Accordion>
    </Grid>
  </Grid>
</UserControl>